import java.util.*;
/**
 * @Author: YCKOKO
 * @Date: 2023-05-14
 * @Time:11:50
 * @Description:
 */
public class demo1 {
    public static boolean isHuiWen(String s) {
        StringBuffer sb = new StringBuffer(s);
        sb.reverse();
        String reverseStr = sb.toString();
        if (reverseStr.equals(s)) {
            return true;
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String s1 = scan.nextLine();
        String s2 = scan.nextLine();
        int count = 0;
        String[] str = new String[s1.length() + 1];
        for (int i = 0; i < str.length; i++) {
            str[i] = s1.substring(0, i) + s2 + s1.substring(i);
        }
        for (int i = 0; i < str.length; i++) {
            if (isHuiWen(str[i])) {
                count++;
            }
        }
        System.out.println(count);
    }

}
